package group.program.mapper;

import group.program.pojo.Document;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface FileMapper {
    @Insert("INSERT INTO documents (title, content, vector) VALUES (#{originalFilename}, #{fileData}, #{mergedVector})")
    void addNewFile(
            @Param("originalFilename") String originalFilename,
            @Param("fileData") String fileData,
            @Param("mergedVector") byte[] mergedVector);
    @Select("SELECT * FROM documents")
    List<Document> selectAll();
}
